﻿using System;
using System.Collections.Generic;
using System.Text;

using DupeKill.Core.Discovery; 

namespace DupeKill.Core
{
    public class FileSetLoader
    {
        private FileSet target; 
        public FileSetLoader(FileSet target)
        {
            if (target == null)
                throw new ArgumentNullException();

            this.target = target; 
        }

        public void LoadAll(IFileIterator iterator)
        {
            if (iterator == null)
                throw new ArgumentNullException();

            iterator.Reset();
            while (iterator.Next())
            {
                target.Add(new FileInformation(iterator.FullPath, iterator.Length)); 
            }
        }
    }
}
